home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************
- CLASS: MiscArrowButtonCell
- INHERITS FROM: ButtonCell
- PROGRAMMER: Todd Thomas, Copyright 1993, 1994 by Todd Thomas
- START DATE: Jan 16, 1993
- LAST CHANGED: Oct. 1, 1994
- VERSION 1.1
- CHANGES: See the end of the implementation file.
-
- With the help of ArrowButton, this is a recreation of the
- button (well, it was a View there) from Websters.app (in the
- Preferences panel).
-
- I created a new designated initializer, since it would be nice
- to be able to set both sides of the button at once. Also, since
- stringValue did not return anything useful, I made it return a
- pointer to either the contents (state 0) or altContents (state 1).
-
- This object is included in the MiscKit by permission from the author
- and its use is governed by the MiscKit license, found in the file
- "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
- for a list of all applicable permissions and restrictions.
- *******************************************************************/
-
- #import <appkit/appkit.h>
-
- // Use the method setArrowAlignment: with these defines
- // Used to use method setAlignment: but realized I still needed that method
-
- #define MISC_ARROW_ABSOLUTE 0
- #define MISC_ARROW_RELATIVE 1
-
-
- @interface MiscArrowButtonCell : ButtonCell
- {
- float cellHeight;
- unsigned int arrowAlignment;
- }
-
- + initialize;
- - init;
- - initTextCell: (const char *)aString;
- - initTextCell: (const char *)aString altTitle: (const char *)altString;
-
- - (const char *)stringValue;
- - calcCellSize: (NXSize *)theSize inRect: (NXRect *)theRect;
- - getTitleRect: (NXRect *)theRect;
- - getAltTitleRect: (NXRect *)theRect;
- - setArrowAlignment: (int)alignment;
- - (int)arrowAlignment;
-
- - drawInside: (const NXRect *)cellFrame inView: controlView;
- - drawSelf: (const NXRect *)cellFrame inView: controlView;
-
- - read: (NXTypedStream *)stream;
- - write: (NXTypedStream *)stream;
-
- @end
-